Quadranoid.prototype.render_title = function ()
{
	this._title_back.fill ( 0, 0, CGE.canvas.w, CGE.canvas.h );
	this._quadranoid.blit ( 50, 30, this._quadra_alpha );

	this._quadra_alpha += this._quadra_alpha_delta;
	if ( this._quadra_alpha <= 0 )
	{
		this._quadra_alpha_delta = 3;
	} else if ( this._quadra_alpha >= 100 )
	{
		this._quadra_alpha_delta = -3;
	}

	var t, how_many = this._title_balls.length;

	for ( t = 0; t < how_many; t++ )
		this._title_balls [ t ].draw ();
	
};

Quadranoid.prototype._title_resources = function ()
{
	var images = [ 'ball.png', 'quadranoid.png', 'title_back.png' ];

	images.iterate ( function ( v ) 
	{
		CGE.image_handler.add ( "gfx/" + v, v );
	} );

	this._title_balls = [];

        var t, how_many = 50;

        for ( t = 0; t < how_many; t++ ) this._title_balls.push ( new TBall () );
};

Quadranoid.prototype._prepare_title = function ()
{
	this._title_back = CGE.image_handler.get ( "title_back.png" );

	this._title_back.set_pattern ();
	this._quadranoid = CGE.image_handler.get ( "quadranoid.png" );
	this._quadranoid.zoom ( 50 );

	this._quadra_alpha = 100;
	this._quadra_alpha_delta = -3;
};


function TBall ()
{
        this.img = CGE.image_handler.get ( "ball.png" );

        this.x = Math.floor ( Math.random () * 400 );
        this.y = Math.floor ( Math.random () * 400 );

        this.dx = 5 - Math.floor ( Math.random () * 10 );
        this.dy = 5 - Math.floor ( Math.random () * 10 );

        if ( this.dx == 0 ) this.dx = -4;
        if ( this.dy == 0 ) this.dx = -4;
}

TBall.prototype.draw = function ()
{
        this.img.blit ( this.x, this.y );

        this.x += this.dx;
        this.y += this.dy;

        if ( this.x > 400 || this.x < 0 ) this.dx = - this.dx;
        if ( this.y < 0 || this.y > 400 ) this.dy = - this.dy;
};


